<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="tree.css" />
        <script type="text/javascript" src="treecontrol.js"></script>
        <script type="text/javascript">
            var XpathConstants = {
                MESSAGE: "*[local-name()='message']",
                PART: "*[local-name()='part']",
                ATTRIBUTE: "*[local-name()='attribute']"
            };
            
            var schema = "<TreeSchema><searchPath>//mappingMessage/</searchPath><TreeItem id='messageID'><searchPath>" + XpathConstants.MESSAGE + "</searchPath><description>@id</description><onexpand/><onchange>updateProperty</onchange><icon>/cordys/docex/docexvehicle/style/default/images/icons/massage.gif</icon></TreeItem><TreeItem id='partID'><searchPath>" + XpathConstants.PART + "</searchPath><description>@id</description><onexpand/><onchange>updateProperty</onchange><icon>/cordys/docex/docexvehicle/style/default/images/icons/flow.gif</icon></TreeItem><TreeItem id='attributeID'><searchPath>" + XpathConstants.ATTRIBUTE + "</searchPath><description>@id</description><onexpand/><onchange>updateProperty</onchange><icon>/cordys/docex/docexvehicle/style/default/images/icons/attributes.gif</icon></TreeItem></TreeSchema>";
            
            var CUSTOME_MESSAGE = "custommessages";
            
            function init(){
            
                tree = document.getElementById("processSpecificMessage");
                
                //var processMessage = "<root><data1/><data2/></root>";
                var processMessage = '<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><SOAP:Header xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"><header xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/General/1.0/"><sender><reply-to>cn=CPF Application Users S2,cn=CPF Application Users,cn=soap nodes,o=system,cn=cordys,cn=cordys1,o=tpfcloud.com</reply-to><organizationalContext>o=vsdevelop,cn=cordys,cn=cordys1,o=tpfcloud.com</organizationalContext><component>cn=CPF Application Users,cn=soap nodes,o=system,cn=cordys,cn=cordys1,o=tpfcloud.com</component></sender><receiver><component>cn=Cordys Web Gateway,cn=cordys,cn=cordys1,o=tpfcloud.com</component><sent-to xmlns="http://schemas.cordys.com/General/1.0/">socket://SUCRR0001:41758/</sent-to></receiver><msg-id>00505690-4428-11e2-e4ff-4bfaf0aadd13</msg-id><license>License has expired since 388 day(s)</license></header></SOAP:Header><SOAP:Body><GetModelInstanceResponse xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/bsf/uc/webapps/2.0/mtor"><tuple xmlns="http://schemas.cordys.com/bsf/uc/webapps/2.0/mtor"><old><MTOR xmlns="http://schemas.cordys.com/bsf/uc/webapps/2.0/mtor"><BusinessPartners_Country>THE NETHERLANDS</BusinessPartners_Country><BusinessPartners_Language>Dutch</BusinessPartners_Language><BusinessPartners_Currency>European Monetary Union</BusinessPartners_Currency><BusinessPartners_CompanyName>Vanenburg Group</BusinessPartners_CompanyName><BusinessPartners_BPOfInvoiceToGroup>BP00000004</BusinessPartners_BPOfInvoiceToGroup><SupplierBP_CompanyName>Vanenburg India</SupplierBP_CompanyName><Relation7_OrderTypeID>Big Order</Relation7_OrderTypeID><Relation7_OrderAcknowledgementDocControl>NotApplicable</Relation7_OrderAcknowledgementDocControl><Relation7_Allowinvoicingforpartialdeliveredorders>0</Relation7_Allowinvoicingforpartialdeliveredorders><Relation7_PushInvoicefromSales>1</Relation7_PushInvoicefromSales><Relation7_DeliveryControl1>NotApplicable</Relation7_DeliveryControl1><Relation7_Extra3>1</Relation7_Extra3><Relation7_Extra4>1</Relation7_Extra4><Relation7_Extra>18</Relation7_Extra><AccountExecutive_ContactName>Hendrik-Jan van Dalfsen</AccountExecutive_ContactName><AccountExecutive_ContactName>Hendrik-Jan van Dalfsen</AccountExecutive_ContactName><CustomerContact_ContactName null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><CustomerContact_ContactName null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><SiteID_Extra6>BP00000007</SiteID_Extra6><SalesOrderID>GLBO000185</SalesOrderID><SummaryDescription>0/</SummaryDescription><Description>no comments</Description><CustomerBP>BP00000001</CustomerBP><CustomerBPContact null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><CustomerOrderReference null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><OtherReferences null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Country>THE NETHERLANDS</Country><Currency>European Monetary Union</Currency><CurrencyRateFactor>2</CurrencyRateFactor><OrderDate>2012-10-22</OrderDate><OriginQuoteID null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><RequestingPurchaseOrderID null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><AccountExecutive>CON0000001</AccountExecutive><TermsofPayment>By Cash</TermsofPayment><TermsofDelivery>Transportation by Customer</TermsofDelivery><CustomerLocationID>Kiran Loc</CustomerLocationID><DeliveryPeriodafterOrderingDays>18</DeliveryPeriodafterOrderingDays><LatestDeliveryDate>2012-11-09</LatestDeliveryDate><DeliveryControl>NotApplicable</DeliveryControl><ContractID null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><InvoicingStatus>NoInvoicing</InvoicingStatus><InvoiceID null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><InvoicingProcessingDate null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><SupplierBP>BP00000004</SupplierBP><CollaborationControl>Manual</CollaborationControl><OrderStatus>Definition</OrderStatus><OrderType>Big Order</OrderType><SiteID>GLB</SiteID><Extra1>Dutch</Extra1><Extra2>7998157.9735</Extra2><Extra3>0</Extra3><Extra4>Vanenburg Group</Extra4><Extra5 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra6 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra7 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra8 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra9 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra10 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra11 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra12 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra13>BP00000007</Extra13><Extra14>Standard Benton</Extra14><Extra15>0</Extra15><Discount>0</Discount><TaxCodeID>8</TaxCodeID><LogisticDeliveryCondition null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><DeliveryPeriod null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra16>6610047.912</Extra16><Extra17>1388110.0615</Extra17><Extra18 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra19 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra20 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra21 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra22 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra23 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra24 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><Extra25 null="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/><CreatedBy>development.vs@gmail.com</CreatedBy><CreatedDate>2012-10-22T04:42:37.0</CreatedDate><ModifiedBy>development.vs@gmail.com</ModifiedBy><ModifiedDate>2012-11-06T09:34:57.0</ModifiedDate><APPLICATIONID>05324c87-0ac3-044f-0142-238424dce0c5</APPLICATIONID><BOID>05324d5b-0ac3-044f-0142-23841315e358</BOID><TABLEID>SalesOrderHeader</TABLEID><GUID>86c792ce-0ae9-1584-007e-513064375e36</GUID></MTOR></old></tuple></GetModelInstanceResponse></SOAP:Body></SOAP:Envelope>'
                var psm = Docex.loadXMLDocument(processMessage).documentElement.cloneNode(true);
                var treeNode = getTemplateTreeData(psm);
                processTreeMessage = getTemplateTreeItem(treeNode, tree);
                schemaPattern = Docex.loadXMLDocument(schema);
                Tree.attach(tree);
                renderTree(processTreeMessage, schemaPattern, tree);
            }
            
            function renderTree(treeDataXML, treeSchemaXML, treeNode){
                if (treeDataXML != null) {
                    treeNode.setTreeSchema(treeSchemaXML.documentElement);
                    treeNode.setTreeData(treeDataXML);
                    if (treeNode.root) {
                        treeNode.root.expand();
                        
                        var childContainers = treeNode.root.getChildContainer();
                        if (childContainers && childContainers.childNodes &&
                        childContainers.childNodes.length > 0) {
                            childContainers.childNodes[0].expand();
                        }
                        
                        var rootLabel = treeNode.root.getLabel();
                        rootLabel.style.fontWeight = 'normal';
                        rootLabel.className = '';
                    }
                }
            }
            
            function expandHandler(selectedNode){
            }
            
            
            
            /* Lib */
            
            function getTemplateTreeItem(treeItem, tree){
                var processTreeMessage = Docex.loadXMLDocument(" <mappingMessage name='Mapping Specific Messages' id='mappingMessages'/>");
                
                var treeChildNode = Docex.selectXMLNode(treeItem, "message[@id='messages']");
                treeChildNode = (treeChildNode != null) ? treeChildNode : treeItem;
                var mappingMessageNode = Docex.selectXMLNode(processTreeMessage, "mappingMessage");
                for (var treeChild = treeChildNode.firstChild; treeChild; treeChild = treeChildNode.firstChild) {
                    Docex.appendXMLNode(treeChild, mappingMessageNode);
                }
                return processTreeMessage;
            }
            
            function getTemplateTreeData(template){
                var processSpecificMsg = makeTreeItemForTemplate(template);
                var treeNode = formRootNode("template");
                Docex.appendXMLNode(processSpecificMsg, treeNode);
                return treeNode;
            }
            
            function makeTreeItemForTemplate(template){
                if (template.nodeType == 9) {
                    template = template.documentElement;
                }
                if (template != null && template.nodeType == 1) {
                    var id = (template.getAttribute("name") != null) ? template.getAttribute("name") : template.localName;
                    var name = template.localName;
                    var activityId = (template.getAttribute("activityid")) ? template.getAttribute("activityid") : null;
                    
                    
                    var defaultPrefix = (template.prefix != null) ? template.prefix : "ns";
                    var prefix = (template.getAttribute("activityid")) ? "" : defaultPrefix + ":";
                    
                    var templateRoot = null;
                    if (template.getAttribute("type") == "part") {
                        templateRoot = formPartNode(template.localName, id, name, prefix, activityId);
                    }
                    else {
                        templateRoot = formRootNode(template.localName, id, name, prefix, activityId);
                    }
                    
                    var childElement = template.firstChild;
                    var templateChildNode = null;
                    
                    while (childElement != null) {
                        if (childElement.nodeType == 1) {
                            if (childElement.firstChild && childElement.firstChild.nodeType != 3) {
                                templateChildNode = makeTreeItemForTemplate(childElement);
                                if (templateChildNode != null) {
                                    Docex.appendXMLNode(templateChildNode, templateRoot);
                                }
                            }
                            else {
                                templateChildNode = makeTreeItemForTemplate(childElement);
                            }
                            
                            if (templateChildNode != null) {
                                Docex.appendXMLNode(templateChildNode, templateRoot);
                            }
                        }
                        
                        childElement = childElement.nextSibling;
                    }
                    return templateRoot;
                }
            }
            
            function formPartNode(type, id, name, prefix, xpathValue){
                var newDocument = document.implementation.createDocument("", "", null);
                var partNode = newDocument.createElement("part");
                prefix = (prefix == null) ? "ns" : prefix.replace(/^\s+|\s+$/g, "");
                partNode = setPropertyAttributes(partNode, type, id, name, prefix, xpathValue);
                return partNode;
            }
            
            function formRootNode(type, id, name, prefix, xpathValue){
                var newDocument = document.implementation.createDocument("", "", null);
                var messageNode = newDocument.createElement("message");
                prefix = (prefix == null) ? "ns" : prefix.replace(/^\s+|\s+$/g, "");
                messageNode = setPropertyAttributes(messageNode, type, id, name, prefix, xpathValue);
                return messageNode;
            }
            
            function setPropertyAttributes(node, type, id, name, prefix, xpathValue){
                prefix = (prefix == "" || prefix.substring(prefix.length - 1) == ":") ? prefix : prefix + ":";
                if (id) {
                    node.setAttribute("id", id);
                }
                else {
                    node.setAttribute("id", type);
                }
                if (name) {
                    name = name.split(' ').join('').replace(/[^a-zA-Z 0-9 _]+/g, '');
                    node.setAttribute("name", name);
                }
                else {
                    node.setAttribute("name", type);
                }
                
                if (xpathValue) {
                    node.setAttribute("xpath", xpathValue);
                }
                else 
                    if (name) {
                        node.setAttribute("xpath", prefix + name);
                    }
                    else {
                        node.setAttribute("xpath", prefix + type);
                    }
                node.setAttribute("element", prefix + node.getAttribute("name"));
                return node;
            }
            
            var Docex = {};
            Docex.Browser = {};
            
            Docex.Browser.isIE = (function(){
                if (navigator.appVersion.indexOf("MSIE") != -1) 
                    return true;
                return false;
            })();
            
            Docex.createAttributeNS = function(xmlDocument, namespaceURI, qualifiedName){
                if (xmlDocument.createAttributeNS) {
                    return xmlDocument.createAttributeNS(namespaceURI, qualifiedName);
                }
                else {
                    // IE
                    return xmlDocument.createNode(2, qualifiedName, namespaceURI);
                }
            }
            
            Docex.setXMLAttribute = function(elementNode, attributeNamespace, attributeName, attributeValue){
                var attributeNode = Docex.createAttributeNS(elementNode.ownerDocument, attributeNamespace, attributeName);
                attributeNode.nodeValue = attributeValue;
                if (elementNode.setAttributeNodeNS) {
                    return elementNode.setAttributeNodeNS(attributeNode);
                }
                else {
                    //IE
                    return elementNode.setAttributeNode(attributeNode);
                }
            }
            
            Docex.selectXMLNodes = function(object, xpathExpression, namespaces){
                if (!Docex.Browser.isIE) {
                    try {
                        var result = {
                            length: 0
                        };
                        // = new XMLSelectionList(object,xpathExpression);
                        var xmlDocument = (object.ownerDocument || object);
                        if (namespaces) {
                            var savedNamespaces = (xmlDocument.__namespaces || null);
                            xmlDocument.__namespaces = namespaces;
                        }
                        var nodeList = xmlDocument.evaluate(xpathExpression, object, Docex.__createNSResolver(xmlDocument), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                        var node, nodeIndex = 0;
                        if (node = nodeList.iterateNext()) {
                            do {
                                result[nodeIndex++] = node;
                            }
                            while (node = nodeList.iterateNext())
                            result.length = nodeIndex;
                        }
                        if (namespaces) {
                            xmlDocument.__namespaces = savedNamespaces;
                        }
                        return result;
                    } 
                    catch (e) {
                        throw "selectXMLNodes: expression '" + xpathExpression + "' cannot be evaluated. " + e.message;
                    }
                }
                else {
                    try {
                        var xmlDocument = (object.ownerDocument || object);
                        var isXSLPattern = (xmlDocument.getProperty("SelectionLanguage") === "XSLPattern");
                        if (isXSLPattern) {
                            xmlDocument.setProperty("SelectionLanguage", "XPath");
                        }
                        if (namespaces) {
                            var savedNamespaces = xmlDocument.getProperty("SelectionNamespaces"); //NOMBV
                            cordys.setXMLNamespaces(xmlDocument, namespaces);
                        }
                        var result = object.selectNodes(xpathExpression); //NOMBV
                        if (namespaces) {
                            xmlDocument.setProperty("SelectionNamespaces", savedNamespaces); //NOMBV
                        }
                        if (isXSLPattern) {
                            xmlDocument.setProperty("SelectionLanguage", "XSLPattern");
                        }
                        return result;
                    } 
                    catch (e) {
                        throw "selectXMLNodes: expression '" + xpathExpression + "' cannot be evaluated. " + e.message;
                    }
                }
            }
            
            Docex.selectXMLNode = function(object, xpathExpression, namespaces){
                if (!Docex.Browser.isIE) {
                    try {
                        var xmlDocument = (object.ownerDocument || object);
                        if (namespaces) {
                            var savedNamespaces = (xmlDocument.__namespaces || null);
                            xmlDocument.__namespaces = namespaces;
                        }
                        var result = xmlDocument.evaluate(xpathExpression, object, Docex.__createNSResolver(xmlDocument), XPathResult.FIRST_ORDERED_NODE_TYPE, null);
                        if (namespaces) {
                            xmlDocument.__namespaces = savedNamespaces;
                        }
                        if (result) 
                            return result.singleNodeValue;
                        return null;
                    } 
                    catch (e) {
                        throw "selectXMLNode: expression '" + xpathExpression + "' cannot be evaluated. " + e.message;
                    }
                }
                else {
                    try {
                        var xmlDocument = (object.ownerDocument || object);
                        var isXSLPattern = (xmlDocument.getProperty("SelectionLanguage") === "XSLPattern");
                        if (isXSLPattern) {
                            xmlDocument.setProperty("SelectionLanguage", "XPath");
                        }
                        if (namespaces) {
                            var savedNamespaces = xmlDocument.getProperty("SelectionNamespaces"); //NOMBV
                            Docex.setXMLNamespaces(xmlDocument, namespaces);
                        }
                        var result = object.selectSingleNode(xpathExpression); //NOMBV
                        if (namespaces) {
                            xmlDocument.setProperty("SelectionNamespaces", savedNamespaces); //NOMBV
                        }
                        if (isXSLPattern) {
                            xmlDocument.setProperty("SelectionLanguage", "XSLPattern");
                        }
                        return result;
                    } 
                    catch (e) {
                        throw "selectXMLNode: expression '" + xpathExpression + "' cannot be evaluated. " + e.message;
                    }
                }
            }
            
            Docex.getTextContent = function(node){
                if (node != null) {
                    var text = node.textContent || node.text;
                    return text ? text : "";
                }
                else {
                    return null;
                }
            }
            
            Docex.setTextContent = function(node, value){
                if (node != null) {
                    if (Docex.Browser.isIE)// ie
                        node.text = value;
                    else 
                        node.textContent = value;
                }
            }
            
            Docex.setNodeText = function(node, xpath, value, namespaces){
                if (node && (node = Docex.selectXMLNode(node, xpath, namespaces))) {
                    Docex.setTextContent(node, value);
                    return true;
                }
                return false;
            }
            
            Docex.getNodeText = function(node, xpath, defaultValue, namespaces){
                if (node && (node = Docex.selectXMLNode(node, xpath, namespaces))) {
                    return (Docex.getTextContent(node) || defaultValue || "");
                }
                return defaultValue;
            }
            
            Docex.parseStringToXML = function(sXML){
                if (!Docex.Browser.isIE) {
                    var parser = new DOMParser();
                    try {
                        return getFeedsRequest = parser.parseFromString(sXML, "application/xml");
                    } 
                    catch (err) {
                        Docex.notify("error", err.description, "Parsing Error");
                        return false;
                    }
                }
                else {
                    try {
                        var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.6.0");
                        xmlDoc.setProperty("SelectionLanguage", "XPath");
                        xmlDoc.async = false;
                        xmlDoc.loadXML(sXML);
                        return xmlDoc;
                    } 
                    catch (err) {
                        Docex.notify("error", err.description, "Parsing Error");
                        return false;
                    }
                }
            }
            
            Docex.getXMLDocument = function(){
                if (Docex.Browser.isIE) 
                    return new ActiveXObject("MSXML2.DOMDocument.6.0"); //NOMBV
                else 
                    return document.implementation.createDocument("", "", null);
            }
            
            Docex.cloneXMLDocument = function(doc){
                var clonedDoc = Docex.getXMLDocument();
                if (doc.documentElement) {
                    var docFragment = clonedDoc.createDocumentFragment();
                    docFragment.appendChild(clonedDoc.importNode(doc.documentElement, true));
                    clonedDoc.appendChild(docFragment);
                }
                Docex.setXMLNamespaces(clonedDoc, Docex.getXMLNamespaces(doc));
                return clonedDoc;
            }
            
            Docex.setXMLNamespaces = function(object, namespaces){
                if (!Docex.Browser.isIE) {
                    var xmlDocument = (object.ownerDocument || object);
                    xmlDocument.__namespaces = namespaces;
                }
                else {
                    var xmlDocument = (object.ownerDocument || object), res = "";
                    for (var prefix in namespaces) {
                        if (prefix.indexOf("xml") == 0 || !namespaces[prefix]) 
                            continue;
                        if (res.length > 0) 
                            res += " ";
                        res += "xmlns:" + prefix + "='" + namespaces[prefix] + "'";
                    }
                    xmlDocument.setProperty("SelectionNamespaces", res); //NOMBV
                }
            }
            
            Docex.getXMLNamespaces = function(object){
                var xmlDocument = (object.ownerDocument || object);
                return (xmlDocument.__namespaces || null);
            }
            
            Docex.getXML = function(node){
                if (Docex.Browser.isIE) 
                    return node.xml;
                else 
                    return (new XMLSerializer()).serializeToString(node);
            }
            
            Docex.__createNSResolver = function(xmlDocument){
                if (xmlDocument.__namespaces) {
                    return function(prefix){
                        return xmlDocument.__namespaces[prefix] || null;
                    }
                }
                return null;
            };
            
            Docex.loadXMLDocument = function(xmlString, xmlDocument){
                if (!xmlDocument) 
                    xmlDocument = Docex.getXMLDocument();
                
                if (xmlDocument) {
                    if (Docex.Browser.isIE) {
                        xmlDocument.loadXML(xmlString); //NOMBV
                        return xmlDocument;
                    }
                    
                    setReadyState(xmlDocument, 1);
                    xmlDocument.parseError = {
                        "errorCode": 0,
                        "reason": ""
                    };
                    // get a new XML document if the xml contained is a dummy node with nothing inside e.g. <xml id="xmlID"/> //NOMBV
                    // the issue resolved is 'no element found' error - but this could save already existing forms with that issue
                    var oDoc = (xmlString.replace(/\s/g, "") != "") ? (new DOMParser()).parseFromString(xmlString, "text/xml") : this.getXMLDocument();
                    setReadyState(xmlDocument, 2);
                    if (!xmlDocument || !xmlDocument.preserveWhiteSpace) 
                        cleanWhitespace(oDoc.documentElement);
                    var node = xmlDocument.firstChild;
                    // Cleanup "to" document
                    while (node) {
                        xmlDocument.removeChild(node);
                        node = xmlDocument.firstChild;
                    }
                    // Exchange nodes..
                    if (node = oDoc.firstChild) {
                        var xmlDocument = (xmlDocument.ownerDocument || xmlDocument);
                        var xmlDocumentFragment = xmlDocument.createDocumentFragment();
                        while (node) {
                            xmlDocumentFragment.appendChild(xmlDocument.importNode(node, true));
                            node = node.nextSibling;
                        }
                        xmlDocument.appendChild(xmlDocumentFragment);
                    }
                    setReadyState(xmlDocument, 3);
                    var reason = Docex.getNodeText(oDoc, ".//*[local-name() ='parsererror']", null);
                    if (!oDoc.documentElement || reason) {
                        var errorExp = /([\s\S]*?)Location:([\s\S]*?)Line Number (\d+), Column (\d+):([\s\S]*?)(?:\-*\^)/g;
                        errorExp.test(reason);
                        xmlDocument.parseError = {
                            "errorCode": -1,
                            "line": RegExp.$3,
                            "linepos": RegExp.$4,
                            "reason": RegExp.$1 || reason,
                            "srcText": RegExp.$5 || xmlString,
                            "url": RegExp.$2 || document.location
                        };
                    }
                    setReadyState(xmlDocument, 4);
                }
                return xmlDocument;
                
            }
            
            Docex.createElementNS = function(xmlDocument, namespaceURI, qualifiedName){
                if (Docex.Browser.isIE) {
                    return xmlDocument.createNode(1, qualifiedName, namespaceURI); //NOMBV
                }
                else {
                    var elementNode = xmlDocument.createElementNS(namespaceURI, qualifiedName);
                    if (!namespaceURI) {
                        var namespaceAttr = xmlDocument.createAttribute("xmlns");
                        namespaceAttr.value = "";
                        elementNode.attributes.setNamedItem(namespaceAttr);
                    }
                    return elementNode;
                }
            }
            
            Docex.appendXMLNode = function(fromNode, toNode){
                if (Docex.Browser.isIE) 
                    return toNode.appendChild(fromNode);
                
                var toNodeDocument = toNode.ownerDocument || toNode;
                if (fromNode.ownerDocument != toNodeDocument) {
                    fromNode = toNodeDocument.adoptNode(fromNode);
                }
                var toNodeDocFragment = toNodeDocument.createDocumentFragment();
                var newNode = toNodeDocFragment.appendChild(fromNode);
                toNode.appendChild(toNodeDocFragment);
                return newNode;
            }
            
            Docex.xml2nicestring = function(xml, level, htmlObject, allowSelfClosingTags){
                if (typeof(allowSelfClosingTags) == "undefined") {
                    allowSelfClosingTags = true;
                }
                var s = [];
                if (typeof(level) == "undefined") 
                    level = 0;
                var tabs = "";
                while (level--) {
                    tabs += "  ";
                }
                
                __xml2nicestring(xml, true, s, "", tabs, allowSelfClosingTags);
                var prettyXmlString = s.join("");
                
                if (htmlObject) {
                    if (htmlObject.tagName == "TEXTAREA") {
                        htmlObject.value = prettyXmlString;
                    }
                    else {
                        Docex.setTextContent(htmlObject, prettyXmlString);
                    }
                }
                
                return prettyXmlString;
            }
            
            Docex.getEventTarget = function(eventObject){
                return eventObject.__cordysCustomEvent ? eventObject.srcElement : ((eventObject.target.nodeType == 1) ? eventObject.target : eventObject.target.parentNode); //NOMBV(2)
            }
            
            Docex.addDOMListener = function(element, eventType, handler){
                return element.addEventListener(eventType.substr(2), handler, false);
            }
            
            Docex.removeDOMListener = function(element, eventType, handler){
                return element.removeEventListener(eventType.substr(2), handler, false);
            }
            
            Docex.getComputedStyle = function(element){
                if (element && typeof(element) != "undefined") {
                    return element.currentStyle; //NOMBV
                }
                return null;
            }

            function setReadyState(xmlDocument, iReadyState){
                xmlDocument._readyState = iReadyState;
                if (xmlDocument.onreadystatechange != null && typeof xmlDocument.onreadystatechange == "function") 
                    xmlDocument.onreadystatechange();
            }
            
            function cleanWhitespace(element){
                if (element) {
                    var child = element.firstChild;
                    while (child) {
                        var nextSibling = child.nextSibling;
                        if ((child.nodeType == 3) && !(/[^\t\n\r ]/.test(child.data))) {
                            /* Don't clear the whitespace when it a single child of spaces (without siblings and without newlines) to avoid cleaning <a>   </a>*/
                            if (child.nextSibling || child.previousSibling || /[\n\r]/.test(child.data)) {
                                element.removeChild(child);
                            }
                        }
                        else {
                            cleanWhitespace(child);
                        }
                        child = nextSibling;
                    }
                }
            }
        </script>
    </head>
    <body onload="init()" scroll="no" name="processVariable" class="processtreebody" leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0">
        <div id="divProcessVariables" class="groupboxsection" style="height: 75%;">
            <div style="position:relative;height:100%;">
                <div class="treeelementcontainer" style="height:100%;width:100%;">
                    <div type="tree" id="processSpecificMessage" style="height:100%;">
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>
